How can I correctly detect smartphone vs tablet in portrait